Remove-DistributionGroupMember, problems with the "-Confirm" parameter
Hello,I try to remove a member of a distributiongroup on the exchange management shell. My Script ist:Remove-DistributionGroupMember -identity "info" -member <displayname of the user> -confirm... But there occurs a problem with the -confirm parameter. It won't work automatically. Is there any parameter for it (I thaught it was something like "y", "yes", $true or something else but nothing will work). Or is there any possibility to run the script without confirming the Remove-action ?
June 29th, 2009 5:03pm
Hello;Quoting from help:"The Confirm parameter causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm parameter."You are probaly looking for the command to execute without requiring confirmation?If so, try this:
$ConfirmPreference = 'none'
Remove-DistributionGroupMember -identity "info" -member <displayname of the user>
$ConfirmPreference = 'high'
Karl
Free Windows Admin Tool Kit Click here and download it now
June 29th, 2009 5:09pm
Did you try the value of -confirm parameter to $false...?
Remove-DistributionGroupMember -identity "info" -member <displayname of the user> -confirm $FalseAmit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
June 30th, 2009 7:26am
Remove-DistributionGroupMember : A parameter cannot be found that matches parameter name'False' At line: 1 char: 31+ Remove-DistributionGroupMember <<<< -identity "info" -member "<displayname of the user>" -confirm $false
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2009 4:14pm
Try
Remove-DistributionGroupMember <<<< -identity "info" -member "<displayname of the user>" -confirm:$false
If that doesnt work, add a space after the -confirm: to make it -confirm: $falseKarl
June 30th, 2009 4:44pm
With and without space, both worked in my case...
Remove-DistributionGroupMember -identity "info" -member <displayname of the user> -confirm:$False
Remove-DistributionGroupMember -identity "info" -member <displayname of the user> -confirm: $False
Reference:
WhatIf, Confirm, and ValidateOnly Parameters
http://technet.microsoft.com/en-us/library/bb124088.aspxAmit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2009 5:07pm
that fixed the error, but it doesn't fix the problem. I still have to confirm manually that i really wan't to remove the user ... :/
June 30th, 2009 5:07pm
Try my original suggestion ;)
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2009 5:10pm
Ok that was the right solution ... Yesterday I forgot the '...' in the Code I think .... 1000 Thanks.
June 30th, 2009 5:17pm
Remove-DistributionGroupMember -Identity 'TestGroup' -Member $v -confirm:$false The following line works great for me. Thanks Karl.
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2009 5:50pm